home *** CD-ROM | disk | FTP | other *** search
- Path: nntp.msstate.edu!phoenix!topher
- From: topher@ERC.MsState.Edu (John Christopher Lakey)
- Newsgroups: comp.lang.c++
- Subject: expression must have class type
- Date: 25 Jan 1996 05:31:46 GMT
- Organization: Mississippi State University
- Message-ID: <4e74k2$jku@NNTP.MsState.Edu>
- NNTP-Posting-Host: phoenix.erc.msstate.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- I get this error when I use a constructor with no args,
- but not when I use one with an arguement.
-
-
- Here's a code example:
-
- class NexRadMessage {
- public:
-
- NexRadMessage();
- //NexRadMessage(char *filename);
- ~NexRadMessage();
-
- ...
-
- };
-
-
- NexRadMessage::NexRadMessage()
- {
- _messageCode = -1;
- }
-
- NexRadMessage::NexRadMessage(char *filename)
- {
- if (filename)
- loadMessage(filename);
- else _messageCode = -1;
- }
-
-
- main(int argc,char **argv)
- {
-
- //NexRadMessage message("argv[1]"); // tested and works (so far).
- NexRadMessage message();
-
- message.loadMessage(argv[1]);
-
- }
-
- "nexrad.C", line 106: error(3240): expression must have class type
- message.loadMessage(argv[1]);
- ^
-
-
-
-
-
- This work fine if I use the first declaration, but not the second.
- Any clue what I've done wrong? I'm using IRIX 5.3 (NCC) C++
-
- c++_dev.sw.c++ 10/16/95 C++ Compiler
-
-
-
- *********************************************************************
- | Chris<topher> Lakey mailto:topher@pobox.com
- | Computer Engineer voice: 205 534-4844
- | Physitron Inc. fax: 205 534-4846
- | Huntsville, AL http://www.pobox.com/~topher
- *********************************************************************
-
-